% Enable hyperlinks
\setupinteraction
  [state=start,
  title={ConTeXt测试},
  author={Ann},
  style=,
  color=,
  contrastcolor=]

% make chapter, section bookmarks visible when opening document
\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
\setupinteractionscreen[option=bookmark]
\setuptagging[state=start]


% use microtypography
\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
\setupalign[hz,hanging]
\setupitaliccorrection[global, always]

\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted

\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][mm][Latin Modern Math]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]
\setupbodyfont[mainface]

\setupwhitespace[medium]

\setuphead[chapter]            [style=\tfd,header=empty]
\setuphead[section]            [style=\tfc]
\setuphead[subsection]         [style=\tfb]
\setuphead[subsubsection]      [style=\bf]
\setuphead[subsubsubsection]   [style=\sc]
\setuphead[subsubsubsubsection][style=\it]

\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]

\definedescription
  [description]
  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]

\setupitemize[autointro]    % prevent orphan list intro
\setupitemize[indentnext=no]

\setupfloat[figure][default={here,nonumber}]
\setupfloat[table][default={here,nonumber}]

\setupthinrules[width=15em] % width of horizontal rules

\setupxtable[frame=off]
\setupxtable[head][topframe=on,bottomframe=on]
\setupxtable[body][]
\setupxtable[foot][bottomframe=on]


\starttext
\startalignment[middle]
  {\tfd ConTeXt测试}
  \smallskip
  {\tfa Ann}
  \smallskip
  {\tfa 2019/4/10}
  \bigskip
\stopalignment

\section[title={Test},reference={test}]

ConTeXt测试

\subsection[title={Code},reference={code}]

\starttyping
#!/bin/bash
echo "hello"
\stoptyping

\stoptext
